const express = require('express');
const {verifyToken, authorize} = require('../controllers/login.js');
const {getUsers, deleteUsers, getUserById, deleteUser, updateUser} = require('../controllers/users.js');

const router = express.Router();

router.route('/').get(verifyToken, authorize('admin'), getUsers).delete(verifyToken, authorize('admin'), deleteUsers);

router.route('/:userId').get(verifyToken, getUserById).delete(verifyToken, deleteUser).put(verifyToken, updateUser);

module.exports = router;
